﻿CREATE TABLE [dbo].[core_moduleview] (
    [Id]       UNIQUEIDENTIFIER NOT NULL,
    [Code]     NVARCHAR (MAX)   NULL,
    [Caption]  NVARCHAR (MAX)   NULL,
    [ModuleId] UNIQUEIDENTIFIER NOT NULL,
    CONSTRAINT [PK_dbo.core_moduleview] PRIMARY KEY NONCLUSTERED ([Id] ASC),
    CONSTRAINT [FK_dbo.core_moduleview_dbo.core_module_ModuleId] FOREIGN KEY ([ModuleId]) REFERENCES [dbo].[core_module] ([Id]) ON DELETE CASCADE
);


GO
CREATE NONCLUSTERED INDEX [IX_ModuleId]
    ON [dbo].[core_moduleview]([ModuleId] ASC);

